package com.zhuzhu.controller;


import com.zhuzhu.pojo.TwoIndex;
import com.zhuzhu.service.TwoIndexService;
import com.zhuzhu.until.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;



@RestController
@CrossOrigin
@RequestMapping("/twoindex")
public class TwoIndexController {
    @Autowired
    private TwoIndexService twoIndexService;

    //    查页面所有信息
    @RequestMapping("/selectAll")
    public Result getTwoIndex(TwoIndex twoIndex) {
        System.out.println("查出来了");
        return twoIndexService.selectAll(twoIndex);
    }

    @RequestMapping("/delete")
    public Result delete(Integer id) {
        return twoIndexService.batchUpdateById(id);
    }

    @RequestMapping("/update")
    public Result update(TwoIndex twoIndex) {
        return twoIndexService.updateById(twoIndex);
    }

    @RequestMapping("/submit")
    public Result submit(Integer id) {
        return twoIndexService.submit(id);
    }


}
